<?php

/**
 * Flickr Photosets - Map Page
 * Embeds the yahoo map of the set or photostream.
 * 
 * @author Brad Dougherty <bdougherty@gmail.com>
 * @version 2.0
 * @date 9/22/07
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License 3.0
 * @since File available since Release 1.0
 */

/*
Require the function library
This will include all other necessary files
*/
require_once 'lib.php';

/*
Initialize Flickr Photosets and Flickr
*/
$fp = new FlickrPhotosetsCanvas(FlickrPhotosetsCanvas::uid_from_url);

// If this is for a set
if (isset($_GET['sid'])) {
	$url = $fp->flickr->urls_getUserPhotos($fp->nsid).'sets/'.$_GET['sid'].'/map/';
	$fp->facebook->redirect($url);
}
// If this is the photostream
else {
	$url = $fp->flickr->urls_getUserPhotos($fp->nsid).$_GET['pid'].'/map/';
	$fp->facebook->redirect($url);
}

?>

<fb:title>Slideshow</fb:title>

<h2>Flickr map</h2>

<h4>
	<?php
	if (isset($_GET['sid'])) {
		echo '<a href="'.$fp->app_url.'/photos/'.$fp->uid.'/sets/'.$_GET['sid'].'/">Back to photoset</a>';
	} else {
		echo '<a href="'.$fp->app_url.'/photos/'.$fp->uid.'/">Back to photostream</a>';
	}
	?>
</h4>

<center><fb:iframe src="<?=$url?>" scrolling="no" frameborder="0" smartsize="true" /></center>
	
<?=$fp->echo_footer()?>